Skip to content

fix: respect lazyHtmlGeneration for consent modal - #832

Closed
Steve0x2a wants to merge 1 commit into
orestbida:masterfrom
Steve0x2a:fix/lazy-consent-modal
Closed

Steve0x2a wants to merge 1 commit into
orestbida:masterfrom
Steve0x2a:fix/lazy-consent-modal

Conversation

@Steve0x2a

Copy link
Copy Markdown

lazyHtmlGeneration is documented as delaying modal markup until a modal is about to become visible, but generateHtml always built the consent modal whenever consent was invalid. With autoShow: false that left an unused role="dialog" in the document.

Gate createConsentModal on lazyHtmlGeneration the same way as the preferences modal. show() still creates the consent modal when consent is invalid, so CookieConsent.show() continues to work.

Credits @okadriu for the report and the named generateHtml path.

Fixes #830

Signed-off-by: Yi Zhan <stevesough@gmail.com>
@netlify

netlify Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cookieconsentv3-playground canceled.

Name Link
🔨 Latest commit 89907e2
🔍 Latest deploy log https://app.netlify.com/projects/cookieconsentv3-playground/deploys/6a9a8f362067df0008c92b55

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@Steve0x2a is attempting to deploy a commit to the Orest Bida's projects Team on Vercel.

A member of the Team first needs to authorize it.

@stale

stale Bot commented Oct 4, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Oct 4, 2026
@stale stale Bot closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: consent modal markup is generated even with autoShow: false and lazyHtmlGeneration: true

1 participant